<!DOCTYPE html>
<html lang="zh-cmn-Hans">

<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta name="format-detection" content="telephone=no" />
    <link rel="stylesheet" href="../../static/mobile/default/css/layout.css?v=2" />
    <link rel="icon" type="image/png" href="../../static/favicon.ico" />
    <script src="../../static/js/jquery/jquery/2.1.4/jquery.min.js"></script>
    <script src="../../static/js/jquery/jquery.cookie.js"></script>
    <script src="../../static/mobile/default/js/page.js?v=1"></script>
    <title>会员登录 - 达漂亮</title>

    <link rel="stylesheet" href="../../static/mobile/default/css/login.css" />


</head>

<body>
    <div class="page ">
        <div class="page-hd">
            <div class="header base-header bor-1px-b">
                <div class="header-left">
                    <a href="javascript:history.go(-1)" class="left-arrow"></a>
                </div>
                <div class="header-title">会员登录</div>
                <div class="header-right">
                    <!-- <a href=""></a> -->
                </div>
            </div>
        </div>

        <div class="page-bd">
            <!-- 页面内容-->
            <div class="top">
                <img src="/upload/image/2020/08/5f3df01d44539.png" alt="">
                <span class="fs34 color_3 fw_b">达漂亮</span>
            </div>
            <div class="inputBlock bor_b">
                <img src="../../static/mobile/default/images/register01.png" alt="" class="imgIcon">
                <input type="text" class="fs32 fw_b textBox" id="mobile" placeholder="账号">
            </div>
            <div class="inputBlock bor_b">
                <img src="../../static/mobile/default/images/register02.png" alt="" class="imgIcon">
                <input type="password" class="fs32 fw_b textBox" id="password" placeholder="密码">
                <div class="ereBox">
                    <img src="../../static/mobile/default/images/login01.png" alt="" data-type="0">
                </div>
            </div>
            <div class="remPassword">
                <label for="remember">
                <div class="iconBox">
                  <input type="checkbox" class="check" name="checkbox1" id="remember" value="1">
                  <i class="icon_checked"></i>
                </div>
                <span class="fs28 color_9">记住密码</span>
            </label>
                <a href="/member/passport/forgetpwd.html" class="fs28 color_9 ">忘记密码</a>
            </div>
            <div class="loginbutton fs32 fw_b color_w BGcolor_r login">登录</div>
            <div class="fs30 goregister"><a href="/publics/download/app.html" class="fw_b color_3">立即下载</a></div>
        </div>


    </div>

    <script src="../../static/js/art-template.js"></script>
    <script src="../../static/mobile/default/js/lib/fastclick.js"></script>
    <script src="../../static/js/jquery/lazyload/jquery.lazyload.js"></script>
    <script>
        $(function() {
            FastClick.attach(document.body);
            $("img.lazy").lazyload({
                effect: "fadeIn",
                event: "scroll",
                container: $(".page-bd")
            });
        });
    </script>

    <script>
        window.onload = function() {
            var oUser = document.getElementById('mobile');
            var oPswd = document.getElementById('password');
            var oRemember = document.getElementById('remember');
            //页面初始化时，如果帐号密码cookie存在则填充
            if (getCookie('mobile') && getCookie('password')) {
                oUser.value = getCookie('mobile');
                oPswd.value = getCookie('password');
                oRemember.checked = true;
            }
            //复选框勾选状态发生改变时，如果未勾选则清除cookie
            oRemember.onchange = function() {
                if (!this.checked) {
                    delCookie('mobile');
                    delCookie('password');
                }
            };
        };
        //设置cookie
        function setCookie(name, value, day) {
            var date = new Date();
            date.setDate(date.getDate() + day);
            document.cookie = name + '=' + value + ';expires=' + date;
        };
        //获取cookie
        function getCookie(name) {
            var reg = RegExp(name + '=([^;]+)');
            var arr = document.cookie.match(reg);
            if (arr) {
                return arr[1];
            } else {
                return '';
            }
        };
        //删除cookie
        function delCookie(name) {
            setCookie(name, null, -1);
        };

        $(function() {
            $('.ereBox').on('click', function() {
                var obj = $(this).find('img')
                if (obj.attr('data-type') == '0') {
                    obj.attr('src', '/static/mobile/default/images/login02.png')
                    obj.attr('data-type', '1')
                    $(this).siblings('input').attr('type', 'text')
                } else {
                    obj.attr('src', '/static/mobile/default/images/login01.png')
                    obj.attr('data-type', '0')
                    $(this).siblings('input').attr('type', 'password')
                }
            })
        })
        $('.login').on('click', function() {
            var arr = new Object();
            arr.mobile = $('#mobile').val();
            arr.password = $('#password').val();
            if (arr.mobile == '') {
                _alert('请输入手机号码.');
                return false;
            }
            if ($('#code').length > 0) {
                arr.code = $('#code').val();

                if (arr.code == '') {
                    _alert('请输入验证码..');
                    return false;
                }
            }
            if (arr.password == '') {
                _alert('请输入用户密码.');
                return false;
            }
            if (arr.password.length < 8) {
                _alert('用户密码长度不能小于八位.');
                return false;
            }
            jq_ajax('/member/api.passport/login.html', arr, function(res) {
                if (res.code == 0) {
                    _alert(res.errmsg);
                    return false;
                }
                var remember = document.getElementById('remember');
                if (remember.checked) {
                    setCookie('mobile', arr.mobile, 30); //保存帐号到cookie，有效期3天
                    setCookie('password', arr.password, 30); //保存密码到cookie，有效期3天
                }
                if (res.url != '') {
                    return window.location.href = res.url;
                }
                window.location.href = '/member/center/index.html';
            })
        })

        function codeButton() {
            var arr = new Object();
            arr.type = 'login';
            arr.mobile = $('#mobile').val();
            if (arr.mobile == '') {
                _alert('请输入手机号码');
                return false;
            }
            jq_ajax('/publics/api.sms/sendcode.html', arr, function(res) {
                if (res.code == 0) {
                    _alert(res.errmsg);
                    return false;
                }
                var timeObj = $('.time')
                var getCodeObj = $('.getCode')
                getCodeObj.hide();
                timeObj.show();
                var time = 60;
                var set = setInterval(function() {
                    timeObj.text("" + --time + "s");
                    if (time <= 0) {
                        timeObj.hide();
                        getCodeObj.show();
                        clearInterval(set);
                    }
                }, 1000);
            })
        }
    </script>

    <div class="alertBox">
        <div class="alertBG"></div>
        <div class="alert">
            <div class="text fs30 color_3 bor_b">

            </div>
            <!-- 单按钮 -->
            <div class="button fs32 fw_b color_r">
                知道了
            </div>
            <!-- 双按钮 -->
            <div class="buttonBox fs32 fw_b">
                <span class="color_9 bor_r cancel">取消</span>
                <span class="color_r confirm">确定</span>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        var is_xcx = 0;
        $(document).on('click', 'a', function() {
            var href = $(this).attr('href');
            if (href.indexOf('/pages') != -1) {
                if (is_xcx == 1) {
                    wx.miniProgram.navigateTo({
                        url: href
                    })
                    return false;
                } else {
                    return false;
                }
            }
        })
    </script>
</body>

</html>